/*
package com.dsj.gxrd.consumer;

import com.dsj.gxrd.config.RabbitMqConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

import java.io.IOException;

*/
/**
 * @author songpin566
 * @date 2023/11/08
 **//*

@Component
public class RabbitMqConsumer {

    @RabbitListener(queues = RabbitMqConfig.QUEUE_NAME,ackMode = "MANUAL")
    public void consumer(String data, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag, Channel channel) throws IOException {
        System.out.println("消费者端的消息:"+data);
        System.out.println("消息唯一标识:"+deliveryTag);
        if(data.contains("123")){
            channel.basicAck(deliveryTag,false);
        }else {
            channel.basicNack(deliveryTag,false,true);
        }

    }

}
*/
